/*
 * @Author: 过峰 2452342725@qq.com
 * @Date: 2022-09-16 16:00:29
 * @LastEditors: 过峰 2452342725@qq.com
 * @LastEditTime: 2022-11-09 10:36:06
 * @FilePath: \desert-star\scripts\proxy.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/**
 * 在生产环境 代理是无法生效的，所以这里没有生产环境的配置
 * The agent cannot take effect in the production environment
 * so there is no configuration of the production environment
 * For details, please see
 * https://pro.ant.design/docs/deploy
 */
// const proxyTarget = 'http://172.16.5.33:8000' // 正式
// const proxyTarget = 'http://172.16.5.183:8000'  // 开/发
// const proxyTarget = 'http://172.16.5.157:8000'  // uat
const proxyTarget = 'http://172.16.5.184:8000' // 测/试
// const proxyTarget = 'http://172.16.13.80:8000'
// const proxyTarget = 'http://172.16.5.195:10005'
// const proxyTarget = 'http://172.16.5.198:10011' // syf
// const proxyTarget = 'http://172.16.5.195:10004' // zb
// const proxyTarget = 'http://172.16.5.172:8000' // lcl
// const proxyTarget = 'http://172.16.5.196:8000' // hw
// const proxyTarget =  'http://172.16.5.185:8989' //lf

module.exports = {
  // pre: {
  //   '/api/': {
  //     target: 'https://preview.pro.ant.design',
  //     changeOrigin: true,
  //     pathRewrite: { '^': '' },
  //   },
  // },
  // test: {
  //   '/api/': {
  //     target: 'https://preview.pro.ant.design',
  //     changeOrigin: true,
  //     pathRewrite: { '^': '' },
  //   },
  // },
//  config/proxy.js  添加
//  config/proxy.js  添加
  local: {
    '/api/': {
      target: '/',
      changeOrigin: true,
      pathRewrite: {
        '^/api': '',
      },
    },
  },
  mock: {
    '/api/': {
      target: 'http://127.0.0.1:4000',
      changeOrigin: true,
      pathRewrite: {
        '^/api': '',
      },
    },
  },
  dev: {
    // '/api/repo/': {
    //   target: 'http://172.16.5.185:8989',
    //   changeOrigin: true,
    //   pathRewrite: { '^/api/repo': '' },
    // },
    '/api/': {
      target: proxyTarget,
      changeOrigin: true,
      pathRewrite: { '^/api': '' },
    },
    '/node/': {
      target: 'http://localhost:9909/',
      changeOrigin: true,
      pathRewrite: { '^/node': '' },
    },
    '/fastapi/': {
      target: 'http://localhost:8000/',
      changeOrigin: true,
      pathRewrite: { '^/fastapi': '' },
    },

  },
  // development: {
  //   '/api/': {
  //     target: proxyTarget,
  //     changeOrigin: true,
  //     pathRewrite: { '^/api/': '' },
  //   },
  // },
}
